home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.1 KB | 109 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWSUSink.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef FWSUSINK_H
- #include "FWSUSink.h"
- #endif
-
- #ifndef FWSUUTIL_H
- #include "FWSUUtil.h"
- #endif
-
- //========================================================================================
- // Runtime Informations
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwodmisc
- #endif
-
- //========================================================================================
- // CLASS FW_PStorageUnitSink
- //========================================================================================
-
-
- //----------------------------------------------------------------------------------------
- // FW_PStorageUnitSink::FW_PStorageUnitSink
- //----------------------------------------------------------------------------------------
- FW_PStorageUnitSink::FW_PStorageUnitSink(Environment* ev, FW_OStorageUnitSink* theStorageUnitSink) :
- FW_PRandomAccessSink(ev, theStorageUnitSink)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PStorageUnitSink::FW_PStorageUnitSink
- //----------------------------------------------------------------------------------------
- FW_PStorageUnitSink::FW_PStorageUnitSink(Environment* ev, ODStorageUnitView* storageUnitView) :
- FW_PRandomAccessSink(ev, new FW_OStorageUnitSink())
- {
- ((FW_OStorageUnitSink*)GetRep())->InitFromStorageUnitView(ev, storageUnitView);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PStorageUnitSink::FW_PStorageUnitSink
- //----------------------------------------------------------------------------------------
- FW_PStorageUnitSink::FW_PStorageUnitSink(Environment* ev,
- ODStorageUnit* storageUnit,
- ODPropertyName propertyName,
- ODValueType valueType) :
- FW_PRandomAccessSink(ev, new FW_OStorageUnitSink())
- {
- ((FW_OStorageUnitSink*)GetRep())->InitFromStorageUnitAndProperty(ev, storageUnit, propertyName, valueType);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PStorageUnitSink::~FW_PStorageUnitSink
- //----------------------------------------------------------------------------------------
- FW_PStorageUnitSink::~FW_PStorageUnitSink()
- {
- }
-
- //========================================================================================
- // class FW_PFileValueSink
- //========================================================================================
-
- FW_DEFINE_AUTO (FW_PFileValueSink)
-
- //----------------------------------------------------------------------------------------
- // FW_PFileValueSink::FW_PFileValueSink
- //----------------------------------------------------------------------------------------
-
- FW_PFileValueSink::FW_PFileValueSink (Environment* ev, ODStorageUnit* storageUnit, ODPropertyName propertyName) :
- fHfsInfo(PrivMacGetHFSFlavor(ev, storageUnit, propertyName)),
- fSpecification(ev, fHfsInfo.fileSpec),
- fPermission(FW_kRead, FW_kDenyWrite),
- fFile(ev, fSpecification, fPermission),
- fSink(ev, fFile)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PFileValueSink::~FW_PFileValueSink
- //----------------------------------------------------------------------------------------
-
- FW_PFileValueSink::~FW_PFileValueSink ()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PFileValueSink::PrivMacGetHFSFlavor
- //----------------------------------------------------------------------------------------
-
- HFSFlavor FW_PFileValueSink::PrivMacGetHFSFlavor(Environment* ev, ODStorageUnit* storageUnit, ODPropertyName propertyName)
- {
- HFSFlavor HFSInfo;
- FW_Boolean found = FW_MacSUReadHFSFlavor(ev, storageUnit, propertyName, HFSInfo);
- FW_ASSERT(found);
- return HFSInfo;
- }
-
-
-